home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / mcu11 / examples.arc / EX4TEXT < prev    next >
Text File  |  1988-11-29  |  2KB  |  74 lines

  1. * Program segments - not intended for assembly as is.
  2.  
  3. * On entry, A=data to be programmed and X=an EEPROM address
  4. *        "
  5. *        "
  6. PROG   LDAB  #$02
  7.        STAB  $103B      Set EELAT bit (EEPGM=0)
  8.        STAA  0,X        Store data to EEPROM address
  9.        LDAB  #$03
  10.        STAB  $103B      Set EEPGM bit (EELAT=1)
  11.        JSR   DLY10      Delay 10 mS
  12.        CLR   $103B      Turn off high voltage & set to read mode
  13. *        "
  14. *        "
  15.  
  16. *        "
  17. *        "
  18. BULKE  LDAB  #$06
  19.        STAB  $103B      Set to BULK erase mode
  20.        STAB  $B600      Write any data to any EEPROM address
  21.        LDAB  #$07
  22.        STAB  $103B      Turn on programming voltage
  23.        JSR   DLY10      Delay 10 mS
  24.        CLR   $103B      Turn off high voltage & set to read mode
  25. *        "
  26. *        "
  27.  
  28. * On entry, X=any address in ROW to be erased
  29. *        "
  30. *        "
  31. ROWE   LDAB  #$0E
  32.        STAB  $103B      Set to ROW erase mode
  33.        STAB  0,X        Write any data to any address in ROW
  34.        LDAB  #$0F
  35.        STAB  $103B      Turn on high voltage
  36.        JSR   DLY10      Delay 10 mS
  37.        CLR   $103B      Turn off high voltage & set to read mode
  38. *        "
  39. *        "
  40.  
  41.  
  42. * On entry, X=any address of BYTE to be erased
  43. *        "
  44. *        "
  45. BYTEE  LDAB  #$16
  46.        STAB  $103B      Set to BYTE erase mode
  47.        STAB  0,X        Write any data to address to be erased
  48.        LDAB  #$17
  49.        STAB  $103B      Turn on high voltage
  50.        JSR   DLY10      Delay 10 mS
  51.        CLR   $103B      Turn off high voltage & set to read mode
  52. *        "
  53. *        "
  54.  
  55. * On entry, A=data to be programmed into CONFIG
  56. *        "
  57. *        "
  58. CNFCH  LDAB  #$06
  59.        STAB  $103B      Set to BULK erase mode
  60.        STAB  $103F      Write any data to CONFIG address
  61.        LDAB  #$07
  62.        STAB  $103B      Turn on programming voltage
  63.        JSR   DLY10      Delay 10 mS
  64.        LDAB  #$02
  65.        STAB  $103B      Turn off EEPGM, leave EELAT on
  66.        STAA  $103F      Store new CONFIG data
  67.        LDAB  #$03
  68.        STAB  $103B      Set EEPGM bit (EELAT=1)
  69.        JSR   DLY10      Delay 10 mS
  70.        CLR   $103B      Turn off high voltage & set to read mode
  71. *        "
  72. *        "
  73.  
  74.